home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 28
/
028.d81
/
guess number
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
107 lines
1 gosub60100
10 print"[147] [199]uess [212]he [206]umber"
15 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
20 ez$="e": print"[197]asy or [200]ard? [[197]/[200]]"
25 getez$:ifez$<>"e"andez$<>"h"then25
30 ez$=left$(ez$,1): if (ez$ = "[197]") then ez$ = "e"
40 hi = +100: lo = -100
50 if (ez$ = "e") then hi = 10: lo = 0
60 print "[199]uess [212]he [206]umber [198]rom " lo + 1 "to" hi
70 print "[208]ress [[210][197][212][213][210][206]] [215]hen [196]one."
80 n = rnd(0)*(hi - (lo)) + lo + .5
90 n = int( n * 10 ) / 10
100 if (ez$ = "e") then n = int(n)
110 gosub 10190
120 get k$: if k$ <> chr$(13)then 120
130 print"[212]he [193]nswer [201]s ";n
140 print"[208]ress: [[193]] to guess another number."
141 print" [[195]] to choose [197][193][211][217] or [200][193][210][196]."
142 print" [[210]] to return to [204][207][193][196][211][212][193][210]."
145 getk$:ifk$=""then145
150 if k$ = "a" or k$="[193]" then 60
152 ifk$="c"ork$="[195]"then10
155 ifk$<>"r"andk$<>"[210]"then145
160 open15,8,15,"r0:hello connect=hello connect"
170 input#15,er:close15
180 ifer<>63thenend
190 printchr$(147):load"hello connect",8
10000 rem blink the disk error light
10010 rem nl number of times
10020 open 15,8,15
10030 if nl<1 then gosub 10140: gosub 10140: (NULL) to 230
10040 gosub 10140
10050 for jl=1 to nl
10060 : for il=1 to lt
10070 : print#15,"m-e"chr$(0)chr$(193)
10080 : next il
10090 : gosub 10140
10100 next jl
10110 close 15
10120 return
10130 rem delay
10140 for il=1 to 20*lt
10150 next il
10160 return
10170 rem divide number into decades
10180 rem and send each digit out
10190 n$ = str$(n): nd = 0
10200 if len(n$) < 2 then 10300
10210 for kl=1 to len(n$)
10220 : nn$ = mid$(n$,kl,1)
10230 : if nn$=" " then 10290
10240 : if nn$="-" then nl = 5: lt = 1: goto 10280
10250 : if nn$="." then nd = 1: nl = 1: lt = 50: goto 10280
10260 : nl = val(nn$): lt = 10
10270 : if nl = 0 then nl = 1: lt = 2
10280 : gosub 10020
10290 next kl
10300 if ez$<>"e" then: if nd = 0 then nl = 1: lt = 50: gosub 10020
10310 return
60100 pn$="[199]uess the [206]umber":an$="[194][217]: [205]ichael [202]. [203]eryan"
60110 bo=11:sc=15:cl=06:c1=12:c2=00:c3=12:c4=00:c5=00:c6=02:c7=09
60120 rem bo - border color
60121 rem sc - screen color
60122 rem cl - color poked on border
60123 rem c1 - top box outside color
60124 rem c2 - top box inside color
60125 rem c3 - bottom box outside color
60126 rem c4 - bottom box inside color
60127 rem c5 - 'copyright' color
60128 rem c6 - 'program name' color
60129 rem c7 - 'authors name' color
60130 poke53280,bo:poke53281,sc:print"[147]";
60140 poke646,c1:print" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
60150 poke646,c2:print" [165] [204][207][193][196][211][212][193][210] [208][210][197][211][197][206][212][211]: [167]"
60170 poke646,c1:print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
60180 poke646,c6:print""tab(20-len(pn$)/2);pn$
60190 poke646,c7:print""tab(20-len(an$)/2);an$
60200 poke646,c5:print""tab(13)"[195][207][208][217][210][201][199][200][212] 1986"
60210 printtab(9)"[195][207][205][205][207][196][207][210][197] [208][213][194][204][201][195][193][212][201][207][206][211]"
60220 poke646,c3:print" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
60230 poke646,c4:print" [165] [167]"
60240 poke646,c3:print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":le=1044:ri=1043
60250 pokele,98:pokeri,98:le=le-1:ri=ri+1
60260 co=54272:pokeri+co,cl:pokele+co,cl
60270 ifle=1025then60290
60280 goto60250
60290 pokele,108:pokeri,123:pokele+co,cl:pokeri+co,cl:poke646,cl
60300 le=le+40:ri=ri+40:ifle=1985then60330
60305 ifle=1185thenprint"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
60306 ifle=1825thenprint"[175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175]"
60310 pokele,225:pokeri,97:pokele+co,cl:pokeri+co,cl
60320 goto60300
60330 pokele,124:pokeri,126:pokele+co,cl:pokeri+co,cl
60340 le=le+1:ri=ri-1:ifle=2004thenpoke198,.:goto60360
60350 pokele,226:pokeri,226:pokele+co,cl:pokeri+co,cl:goto60340
60360 print"";
60370 poke646,c2:print"[165][208]ress the [[211][208][193][195][197] [194][193][210]] to continue.[167]"
60380 fora=1to100
60390 geta$:ifa$=" "ora$="[160]"thenreturn
60400 next
60410 print"";
60420 print"[165] [167]"
60430 fora=1to100
60440 geta$:ifa$=" "ora$="[160]"thenreturn
60450 next
60460 goto60360